package com.action;

import com.util.annotation.RequestMapping;
import com.util.annotation.RequestParam;
import com.util.annotation.enums.RequestMethodEnums;

@RequestMapping("/login")
public class LoginAction {
	
	/** 视图前缀 */
	private static final String viewPrefix = "/WEB-INF/views/";

	@RequestMapping(value="/index",method = RequestMethodEnums.POST)
	public String root(
			@RequestParam("userName") String name,
			@RequestParam(value="userPwd") String pwd
			) {
		// TODO 具体 service/dao 层 未实现 暂时忽略
		try {
			if("gx".equals(name) && "1".equals(pwd)){
				return viewPrefix + "success.jsp";
			}
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("---> LoginAction execute.error...");
		}
		return viewPrefix + "error.jsp";
	}

}
